<?php
    session_start();
    include_once('/tool/pdo.php');
    include('/class/login.class.php');
    include('/bll/LoginBLL.php');

    //获取参数
    $uid = isset($_POST['username']) ? $_POST['username'] : "";
    $password = isset($_POST['password']) ? $_POST['password'] : "";
    $code = isset($_POST['code']) ? $_POST['code'] : "";

    $loginBLL=new LoginBLL();
    $message=$loginBLL->login($uid,$password,strtolower($code));
    //销毁验证码session对象
    unset($_SESSION['code']);
    //输出json字符串
    echo json_encode($message,JSON_UNESCAPED_UNICODE);
?>